home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / MATH / NRPAS13 / ZBRAC.DEM < prev    next >
Text File  |  1991-04-29  |  619b  |  32 lines

  1. PROGRAM d9r2(input,output);
  2. (* driver for routine ZBRAC *)
  3. VAR
  4.    succes : boolean;
  5.    i : integer;
  6.    x1,x2 : real;
  7.  
  8. (*$I MODFILE.PAS *)
  9. (*$I BESSJ0.PAS *)
  10.  
  11. FUNCTION fx(x: real): real;
  12. BEGIN
  13.    fx := bessj0(x)
  14. END;
  15.  
  16. (*$I ZBRAC.PAS *)
  17.  
  18. BEGIN
  19.    writeln('bracketing values:':21,'function values:':23);
  20.    writeln('x1':6,'x2':10,
  21.       'bessj0(x1)':21,'bessj0(x2)':12);
  22.    FOR i := 1 to 10 DO BEGIN
  23.       x1 := i;
  24.       x2 := x1+1.0;
  25.       zbrac(x1,x2,succes);
  26.       IF  (succes)  THEN BEGIN
  27.          writeln(x1:7:2,x2:10:2,' ':7,
  28.             fx(x1):12:6,fx(x2):12:6)
  29.       END
  30.    END
  31. END.
  32.